<%page expression_filter="h"/>
<%inherit file="base.html" />
<%def name="online_help_token()"><% return "video" %></%def>
<%!
  import json
  from django.core.serializers.json import DjangoJSONEncoder
  from django.utils.translation import gettext as _
  from openedx.core.djangolib.js_utils import (
      dump_js_escaped_json, js_escaped_string
  )
  from openedx.core.djangolib.markup import HTML, Text
%>
<%block name="title">${_("Video Uploads")}</%block>
<%block name="bodyclass">is-signedin course view-video-uploads</%block>

<%namespace name='static' file='static_content.html'/>

<%block name="header_extras">
% for template_name in ["active-video-upload", "previous-video-upload-list"]:
<script type="text/template" id="${template_name}-tpl">
    <%static:include path="js/${template_name}.underscore" />
</script>
% endfor
</%block>

<%block name="requirejs">
    require(["js/factories/videos_index"], function (VideosIndexFactory) {
        "use strict";
        var $contentWrapper = $(".content-primary");
        VideosIndexFactory(
            $contentWrapper,
            "${image_upload_url | n, js_escaped_string}",
            "${video_handler_url | n, js_escaped_string}",
            "${encodings_download_url | n, js_escaped_string}",
            "${default_video_image_url | n, js_escaped_string}",
            ${concurrent_upload_limit | n, dump_js_escaped_json},
            $(".nav-actions .course-video-settings-button"),
            $contentWrapper.data("previous-uploads"),
            ${video_supported_file_formats | n, dump_js_escaped_json},
            ${video_upload_max_file_size | n, dump_js_escaped_json},
            ${active_transcript_preferences | n, dump_js_escaped_json},
            ${transcript_credentials | n, dump_js_escaped_json},
            ${video_transcript_settings | n, dump_js_escaped_json},
            ${is_video_transcript_enabled | n, dump_js_escaped_json},
            ${video_image_settings | n, dump_js_escaped_json},
            ${transcript_available_languages | n, dump_js_escaped_json}
        );
    });
</%block>

<%block name="content">

<div class="wrapper-mast wrapper">
    <div class="video-transcript-settings-wrapper"></div>
    <header class="mast has-actions has-subtitle">
        <h1 class="page-header">
            <small class="subtitle">${_("Content")}</small>
            <span class="sr">&gt; </span>${_("Video Uploads")}
        </h1>

        % if is_video_transcript_enabled :
        <nav class="nav-actions" aria-label="${_('Page Actions')}">
            <h3 class="sr">${_("Page Actions")}</h3>
            <div class="nav-item">
                <button class="button course-video-settings-button"><span class="icon fa fa-cog" aria-hidden="true"></span> ${_("Course Video Settings")}</button>
            </div>
        </nav>
        % endif
    </header>
</div>

<div class="wrapper-content wrapper">
    <section class="content">
        <article class="content-primary" role="main" data-previous-uploads="${json.dumps(previous_uploads, cls=DjangoJSONEncoder)}"></article>
    </section>
</div>

% if pagination_context:
    <%include file="videos_index_pagination.html"/>
% endif

</%block>
